<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //ES8 对象API扩展
        const school = {
            name: "sgg",
            cities: ["bj", "sh", "sz"],
            lessons: ["java", "前端", "运维"]
        }
        //获取对象所有键
        console.log(Object.keys(school))
        //获取对象所有值
        console.log(Object.values(school))
        //获取对象所有键值对，每个键值对是1个二元数组
        console.log(Object.entries(school))

        //转换map
        let m = new Map(Object.entries(school))
        console.log(m)

        //返回对象属性描述对象
        console.log(Object.getOwnPropertyDescriptors(school))

        //创建对象属性描述对象
        let objDescriptor = Object.create(null, {
            name: {
                value: 'sgg', //对象值
                //对象属性特性
                writable: true,
                configurable: true,
                enumerable: true
            }
        })
    </script>
</body>
</html>